

package com.hazelcast.jet.impl;

import com.hazelcast.internal.cluster.MemberInfo;
import com.hazelcast.jet.config.JobConfig;
import com.hazelcast.jet.core.DAG;
import com.hazelcast.jet.impl.execution.init.ExecutionPlan;
import com.hazelcast.jet.impl.operation.InitExecutionOperation;
import com.hazelcast.spi.annotation.Beta;

import java.util.Map;
import java.util.Set;

/**
 * Jet job metadata observer used primarily for testing.
 * It is invoked exactly before {@link InitExecutionOperation}.
 * <p>
 * The internal state of the observer supposed to be mutable.
 * {@link #onLightJobInvocation} and {@link #onJobInvocation} implementations must not use blocking code.
 *
 * @since 5.4
 */
@Beta
public interface JobInvocationObserver {

    void onJobInvocation(long jobId, Map<MemberInfo, ExecutionPlan> executionPlanMap, DAG dag, JobConfig jobConfig);

    void onLightJobInvocation(long jobId, Set<MemberInfo> members, DAG dag, JobConfig jobConfig);
}
